const webpack = require('webpack')
const merge = require('webpack-merge')
const common = require('./webpack.common')

module.exports = merge(common, {
  devtool: 'cheap-module-eval-source-map',
  devServer: {
    hot: true,
    open: true,
    host: '127.0.0.1',
    port: 9100,
    contentBase: 'public',
    overlay: true,
    proxy: {
      '/api': {
          target: 'https://www.baidu.com',
          changeOrigin: true,
          pathRewrite: {
              '^/api': ''
          }
      },
    }
  },
  plugins: [
    new webpack.HotModuleReplacementPlugin()
  ]
})